package modele;

import java.sql.Date;

public class Formateur extends Personne {

	private String diplome;
	private String presentation;
	private String url_photo;

	public Formateur(int id_personne, String nom, String prenom,
			Date date_naissance, String telephone, String adresse,
			String code_postal, String ville, String email, String password,
			String diplome, String presentation, String url_photo) {
		super(id_personne, nom, prenom, date_naissance, telephone, adresse,
				code_postal, ville, email, password);
		this.diplome = diplome;
		this.presentation = presentation;
		this.url_photo = url_photo;
	}

	// Constructeur vide :
	public Formateur() {
		super();
	}
	
	// Getter & Setter

	public String getDiplome() {
		return diplome;
	}
	public void setDiplome(String diplome) {
		this.diplome = diplome;
	}
	public String getPresentation() {
		return presentation;
	}
	public void setPresentation(String presentation) {
		this.presentation = presentation;
	}
	public String getUrlphoto() {
		return url_photo;
	}
	public void setUrlphoto(String urlphoto) {
		this.url_photo = urlphoto;
	}
	
	@Override
	public String toString() {
		return super.toString() + " diplome=" + diplome
				+ ", presentation=" + presentation + ", urlphoto=" + url_photo
				+ "]";
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((diplome == null) ? 0 : diplome.hashCode());
		result = prime * result
				+ ((presentation == null) ? 0 : presentation.hashCode());
		result = prime * result
				+ ((url_photo == null) ? 0 : url_photo.hashCode());
		return result;
	}



	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Formateur other = (Formateur) obj;
		if (diplome == null) {
			if (other.diplome != null)
				return false;
		} else if (!diplome.equals(other.diplome))
			return false;
		if (presentation == null) {
			if (other.presentation != null)
				return false;
		} else if (!presentation.equals(other.presentation))
			return false;
		if (url_photo == null) {
			if (other.url_photo != null)
				return false;
		} else if (!url_photo.equals(other.url_photo))
			return false;
		return true;
	}

	public Formateur(String nom, String prenom, Date date_naissance,
			String telephone, String adresse, String code_postal, String ville,
			String email, String password, String diplome, String presentation,
			String url_photo) {
		super(nom, prenom, date_naissance, telephone, adresse, code_postal,
				ville, email, password);
		this.diplome = diplome;
		this.presentation = presentation;
		this.url_photo = url_photo;
	} 
	
}